package 数据结构下

/**
 * 求最小值
 */
object Exercise02 {
  def main(args: Array[String]): Unit = {
    val list = List(1, 2, 4, 2, 6, 1)
    val i = list.reduce(min)
    println(i)
  }

  def min(x: Int, y: Int): Int = {
    if (x - y < 0) x else y
  }
}
